"""
    data library
"""
import os

data_dir = "data"
images_dir = "data/images"

def filepath(filename):
    return os.path.join(os.getcwd(), data_dir, filename)

def filepath_images(filename):
    return os.path.join(os.getcwd(), images_dir, filename)

def k():
    print os.getcwd()

player_images = {
     "prev":filepath_images("player_rew-16x16.png"),
     "stop":filepath_images("player_stop-16x16.png"),
     "play":filepath_images("player_play-16x16.png"),
     "pause":filepath_images("player_pause-16x16.png"),
     "next":filepath_images("player_next-16x16.png"),
     "add":filepath_images("player_add-16x16.png"),
     "remove":filepath_images("player_remove-16x16.png"),
     "list":filepath_images("player_list-16x16.png"),
     "options":filepath_images("player_options-16x16.png"),
    }

def filename(url):
    """
        Regresa el nombre del fichero
    """
    n = url.split('/')

    try:
        name = n[-1][:-4]
    except:
        name = ""

    return name
    